package com.first.service.impl;


import com.first.dao.impl.UserDaoImpl;
import com.first.entity.User;
import com.first.service.UserService;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserDaoImpl userDao;


    @Override
    public User authentication(String name, String password) {
        return userDao.authentication(name,password);
    }

    @Override
    public int queryAllUserCount() {
        return userDao.queryAllUserCount();
    }

    @Override
    public int addMainUser(User user) {
        return userDao.addMainUser(user);
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public int resetPasswordById(Integer id) {
        return userDao.resetPasswordById(id);
    }

    @Override
    public List<Map> queryAllUser(User user) {
        return userDao.queryAllUser(user);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public List<Map> getResign() {
        return userDao.getResign();
    }

    @Override
    public int changePassword(String oldPassword, String newPassword, Integer id) {
        return userDao.changePassword(oldPassword,newPassword,id);
    }
}
